OSynC VST plugin, v1.0b.  May 3, 2013 by Alex Mesker and John Cook
http://x37v.com/x37v/osync

OSynC is a way to synchronise performers, computers, applications with OSC.  It is designed to be a stateless system, where performers can join or leave a performance, and receive tempo/time signature and other positional information on a number of time scales to remain in sync effortlessly with a host.  It can also be used as a ReWire-like way to synchronise note-generating events across applications.

OSynC 1.0b.vst grabs transport information from Cubase and formats a number of timing messages as OSC packets (sent over port 10101).

This VST plugin is intended to synchronise Max with a VST host, like Cubase.  This allows Max to be an event generator, and have Cubase score/record synchronised MIDI events.

Order of messages within an OSynC datagram:

	/osync/timestamp 773495082. 23582014.
	/osync/play 1
	/osync/bpm 125.7
	/osync/timesig 4 4
	/osync/fractime 59.665871
	/osync/barcount 12
	/osync/bar 4
	/osync/beat 3
	/osync/fraction 18
	/osync/ramp 0.578125


Please see the enclosed OSynC-route.maxhelp help patch for usage.  This plugin is still beta so please test thoroughly before using in a live context



Usage

1. Place the OSynC-route.maxpat abstraction (and OSynC-route.maxhelp) in your Max search path.

2. Put the OSynC 1.0b.vst plugin into (~)/Library/Audio/Plug-Ins/VST

3. Load OSynC 1.0b.vst onto an audio channel in Cubase.

4. Create a Max patch with a [udpreceive 10101] object connected to the OSynC-route.maxpat abstraction.  See the help patch for other usage.



Limitations

Plugin updates once per signal vector.  If your buffer size is 512 samples, OSynC will send a message every ~11ms (at 44.1kHz).  For most purposes this is adequate, but for tighter timing (or rapid triggering of events) consider using a buffer size of 256 or less.

Plugin does not respect effect 'Bypass' in Cubase.  If you need to stop the plugin from sending OSynC datagrams, disable the plugin.

Has been tested in Cubase (6 and 7, under Mac OS X 10.8) only.  Should work in 10.7.  If you need support for previous OS versions, let me know.

Doesn't work in Ableton Live (but a MaxForLive device is to follow).  If it works or doesn't work in other applications, I'd love to know.  Contact details below.




Bugs

Occasionally, after inserting the VST plugin for the first time after launch, Cubase 7 sends a few thousand OSynC packets, then stops.  This is remedied (permanently for that session) by:

	1. (In Cubase) Going to Devices menu > Device Setup.
	2. Click Built-In Audio in the left menu (or whatever device you are using).
	3. Click 'Control Panel' in the right pane.
	4. Uncheck and recheck "Set Device Attenuation to 0 dB"

I don't know why this happens, but doing this solves the issue for me.  It doesn't seem to do this in Cubase 6.




Other Notes

I am happy to share the VST code with anyone more skilled at building VST plugins.  I'm not a programmer.  Suggestions welcome.

Questions/comments? alex@x37v.com


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. http://creativecommons.org/licenses/by-nc-sa/3.0/